#define _CRT_SECURE_NO_WARNINGS	
#pragma once
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>

typedef int ELEMTYPE;

typedef struct DLNode
{
	ELEMTYPE data;
	struct DLNode* next;
	struct DLNode* prior;
}DLNode;

void Init_DoubleList(DLNode* plist);

DLNode* Buy_NewNode(ELEMTYPE val);

bool Insert_Head(DLNode* plist, ELEMTYPE val);

bool Insert_Tail(DLNode* plist, ELEMTYPE val);

bool Insert_Pos(DLNode* plist, ELEMTYPE val, int pos);

bool Del_Head(DLNode* plist);

bool Del_Tail(DLNode* plist);

bool Del_Pos(DLNode* plist, int pos);

bool Del_Val_First(DLNode* plist, ELEMTYPE val);

bool Del_Val_All(DLNode* plist, ELEMTYPE val);

bool IsEmpty(DLNode* plist);

int Get_Length(DLNode* plist);

void Clear(DLNode* plist);

void Destroy1(DLNode* plist);

void Destroy2(DLNode* plist);

void Show(DLNode* plist);

DLNode* Search(DLNode* plist, ELEMTYPE val);
